const kishMap = {
    A: {
        '1': 1,
        '2': 1,
        '3': 1,
        '4': 1,
        '5': 1,
        '6': 1,
    },
    B1: {
        '1': 1,
        '2': 1,
        '3': 1,
        '4': 1,
        '5': 2,
        '6': 2,
    },
    B2: {
        '1': 1,
        '2': 1,
        '3': 1,
        '4': 2,
        '5': 2,
        '6': 2,
    },
    C: {
        '1': 1,
        '2': 1,
        '3': 2,
        '4': 2,
        '5': 3,
        '6': 3,
    },
    D: {
        '1': 1,
        '2': 2,
        '3': 2,
        '4': 3,
        '5': 4,
        '6': 4,
    },
    E1: {
        '1': 1,
        '2': 2,
        '3': 3,
        '4': 3,
        '5': 3,
        '6': 5,
    },
    E2: {
        '1': 1,
        '2': 2,
        '3': 3,
        '4': 4,
        '5': 5,
        '6': 5,
    },
    F: {
        '1': 1,
        '2': 2,
        '3': 3,
        '4': 4,
        '5': 5,
        '6': 6,
    },
};

export const getKishPeople = (num: string, type: keyof typeof kishMap): number | undefined => {
    let codeMap = kishMap[type];
    if (!codeMap) return undefined;

    const cappedNum: string = parseInt(num) > 6 ? '6' : num;
    return kishMap[type][cappedNum];
};


//随机生成id
export const generateUUID = () =>
    "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
        const r = (Math.random() * 16) | 0
        const v = c === "x" ? r : (r & 0x3) | 0x8
        return v.toString(16)
    })
